
#pragma once

#include "CommonSerializationTests.h"

using namespace System;
using namespace NUnit::Framework;
using namespace ttg::extras::serialization;

namespace CommonTests
{
	namespace extras
	{
		namespace serialization
		{
			[TestFixture]
			public ref class ByteSerialization
			{
				public:
					//Tests with unsafe serialization.
					[Test]
					void NotSafeValueTypeSerialization()
					{
						ByteSerializer serializer(false);
						CommonSerializationTests::ValueTypeSerialization(&serializer);
					}

					[Test]
					void NotSafeStringSerialization()
					{
						ByteSerializer serializer(false);
						CommonSerializationTests::StringSerialization(&serializer);
					}

					[Test]
					void NotSafeObjectSerialization()
					{
						ByteSerializer serializer(false);
						CommonSerializationTests::ObjectSerialization(&serializer);
					}

					//Tests with safe serialization.
					[Test]
					void SafeValueTypeSerialization()
					{
						ByteSerializer serializer(true);
						CommonSerializationTests::ValueTypeSerialization(&serializer);
					}

					[Test]
					void SafeStringSerialization()
					{
						ByteSerializer serializer(true);
						CommonSerializationTests::StringSerialization(&serializer);
					}

					[Test]
					void SafeObjectSerialization()
					{
						ByteSerializer serializer(true);
						CommonSerializationTests::ObjectSerialization(&serializer);
					}

					//Tests of error detection.
					[Test]
					void WrongOrderSerialization()
					{
						ByteSerializer serializer(true);
						CommonSerializationTests::WrongOrderSerialization(&serializer);
					}

					[Test]
					void WrongNameSerialization()
					{
						ByteSerializer serializer(true);
						CommonSerializationTests::WrongNameSerialization(&serializer);
					}
			};
		}
	}
}
